package com.spzx.product.service.impl;

import com.spzx.product.api.domain.Brand;
import com.spzx.product.mapper.BrandMapper;
import com.spzx.product.service.IBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 品牌Service业务层处理
 */
@Service
@Transactional
public class BrandServiceImpl implements IBrandService {

    @Autowired
    BrandMapper brandMapper;

    /**
     * 品牌列表分页查询
     * @param brand 查询条件
     * @return 列表数据
     */
    @Override
    public List<Brand> selectBrandList(Brand brand) {
        return brandMapper.selectBrandList(brand);
    }

    @Override
    public Brand selectBrandById(Long id) {
        return brandMapper.selectBrandById(id);
    }

    @Override
    public int insertBrand(Brand brand) {
        return brandMapper.insertBrand(brand);
    }

    @Override
    public int updateBrand(Brand brand) {
        return brandMapper.updateBrand(brand);
    }

    @Override
    public int deleteBatchBrand(Long[] ids) {
        return brandMapper.deleteBatchBrand(ids);
    }

    @Override
    public List<Brand> getBrandAll() {
        return brandMapper.getBrandAll();
    }
}
